PkgObj=$(LosuSDK_Obj)/sdk/liblosu

cc=cc

CIncFile= $(shell ls $(LosuSDK_Include)/*.h)

cWarning= -Wall
cStd= -std=c99
cOpt= -O2
cInclude= -I$(LosuSDK_Include) -Iinclude
cLink=  -lm 
cFlags= $(cWarning) $(cStd) $(cOpt) $(cInclude)

$(LosuSDK_Lib)/liblosu.a:\
	$(PkgObj)/losu_api.o\
	$(PkgObj)/losu.o\
	$(PkgObj)/losu_gc.o\
	$(PkgObj)/losuh.o\
	$(PkgObj)/losu_malloc.o\
	$(PkgObj)/losu_object.o\
	$(PkgObj)/losu_syntax.o\
	$(PkgObj)/losu_vm.o\

	ar crs $@ $^

$(PkgObj)/losu_api.o: losu_api.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losu.o: losu.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losu_gc.o: losu_gc.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losuh.o: losuh.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losu_malloc.o: losu_malloc.c $(CIncFile)

	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losu_object.o: losu_object.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losu_syntax.o: losu_syntax.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@

$(PkgObj)/losu_vm.o: losu_vm.c $(CIncFile)
	$(cc) $(cFlags) -c $< -o $@